$(function  () {
	$("#inputEmail3").blur(function(event) {
		var data = $(this).val();
		//通过Ajax获取数据
            $.ajax({
                type: "post",
                async: false, //同步执行
                url: "./ajax.php",
                data: {username:data},
                dataType: "json",
                success:function (result) {
                   if(result.error==0){
                   	$('#checkname').append("<span class='glyphicon glyphicon-remove' aria-hidden='true'></span>");
                   }else{
                   	$('#checkname').append("<span class='glyphicon glyphicon-ok' aria-hidden='true'></span>");
                   }
                },
                error: function (errorMsg) {
                   alert('456') ;
                }
            });
	});

	$("#inputEmail3").focus(function () {
		$('#checkname').empty();
	})
})